
#ifndef IBROADPHASE_H
#define IBROADPHASE_H

#include <BSpace>
#include "IOverlapPair.h"

namespace BWE
{
	class ISolver;

	class IBroadphase
	{
	public:
		IBroadphase();
		~IBroadphase();

		void createProxy(BBody* body);
		void updateProxy(BBody* body);
		void removeProxy(BBody* body);
		void clearProxy();

		int overlapPairCount() const;
		IOverlapPair& overlapPair(int index);

	private:
		ISpaceTree			_spaceTree;
		SpaceNodeArray		_spaceNodes;
		SpacePairArray		_spacePairs;
		BSet<IOverlapPair>	_overlapPairs;
	};
}

#endif
